import React from "react";
/**
 * 加载公共组件
 * */
// import Header from '../../components/Header/Header';
// import Footer from '../../components/Footer/Footer';

/**
 * 加载图片或样式文件
 * */
// import 'antd/lib/back-top/style/index.less';


export default class MainSection extends React.Component {
    static propTypes = {
        className   : React.PropTypes.string,
        title       : React.PropTypes.string,
        notScroll   : React.PropTypes.bool
    };

    constructor(props) {
        super(props);
    }

    componentWillUnmount() {
        !this.props.notScroll && window.scrollTo(0, 0);
    }

    render() {
        // const {actions, user, home} = this.props;
        return (
            <div id="mainSection" className={this.props.className}>
                <span className="hide">
                    {
                        (document.title !== this.props.title) ? (document.title = this.props.title || 'e童行') : ''
                    }
                </span>
                {
                    this.props.children
                }
            </div>
        )
    }
}